<template>
	<img src="../../assets/img/compass.png" class="uni-compass" :style="{transform:'rotate('+rotate+'deg)'}" @click="compassClick"/>
</template>

<script>
	export default {
		data() {
			return {
				rotate: 0
			}
		},
		methods: {
			setCompass(detail) {
				if(detail.rotateAngle !== this.rotate) {
					this.rotate = detail.rotateAngle-this.angleCorrect
				}
			},
			compassClick() {
				this.$emit("onClick");
			}
		},
    computed: {
      angleCorrect: {
        get () {
          return this.$store.state.config.backParam.angleCorrect || 0
        }
      }
    }
	}
</script>

<style scoped >
	.uni-compass {
		width: 40px;
		height: 40px;
	}
</style>
